import axios from 'axios';

axios.defaults.timeout = 180000;

// 请求拦截
axios.interceptors.request.use(
  (config) => {
    console.log(config);
    return {
      ...config,
    };
  },
  (error) => {
    return Promise.reject(error);
  }
);

// 响应拦截
axios.interceptors.response.use(
  async (response) => {
    console.log('response', response);
    const { data } = response;

    return data;
  },
  (error) => {
    return Promise.reject(error);
  }
);

export default axios;
